<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ page contentType = "text/html; charset=UTF-8" %>


<html>
<head>

<c:set var="cssFileName">
	<c:out value="${crudViewMeta.cssFileName}" default="default.css"/>
</c:set>
<link rel="stylesheet" href="<c:url value='/css/${cssFileName}'/>" type="text/css">

<title><c:out value="${crudMeta.title}"/>批量数据删除确认页面</title>

</head>

<body>

<table class="top" align="center">
	<tr><td class="headtitle"><c:out value="${crudMeta.title}"/>批量数据删除确认</td></tr>
</table>

<form name="listForm" action="<c:url value='/delete.do'/>" method="POST"/>
	<input type="hidden" name="name" value="<c:out value='${crudMeta.beanName}'/>"/>
	<c:forEach items="${crudMeta.otherWantedParameters}" var="wantedParam">
		<input type="hidden" name="<c:out value='${wantedParam}'/>" value="<c:out value='${param[wantedParam]}'/>">
	</c:forEach>

	<table class="content" width="<c:out value='${crudViewMeta.listTableWidth}'/>">
    
    	<tr>
    	<!--列名称-->
		<c:forEach items="${crudMeta.columnMetas}" var="col">
	  		<c:if test="${col.showInList}">
	  			<td class="headtitle" nowrap><c:out value="${col.title}"/></td>
	  		</c:if>
	  	</c:forEach>
		</tr>
		
		<c:set var="nrOfElements" value="0"/>
		<c:forEach items="${command.records}" var="item" varStatus="s">
			<c:if test="${item.selected}">
		
			<tr class="body">
				<c:forEach items="${crudMeta.columnMetas}" var="col">
					<c:if test="${col.primaryKey}">
						<input type="hidden" 
							name="records[<c:out value='${nrOfElements}'/>].mapContent[<c:out value='${col.colName}'/>]" 
							value="<c:out value="${item.mapContent[col.colName]}"/>">
					</c:if>
		      		<c:if test="${col.showInList}">
			      		<td class="listhead">
			      			<c:if test="${empty col.dictName || !col.needDictReplace}">
				      			<c:out value="${item.mapContent[col.colName]}"/>
			      			</c:if>
			      			
			      			<c:if test="${not empty col.dictName && col.needDictReplace}">
			      				<c:out value="${col.dictMap[item.mapContent[col.colName]]}"/>
			      			</c:if>
			      		</td>
		      		</c:if>
				</c:forEach>		
			</tr>
			<c:set var="nrOfElements"><c:out value="${nrOfElements + 1}"/></c:set>
			
			</c:if>
		</c:forEach>	
	</table>
	<input type="hidden" name="nrOfElements" value="<c:out value='${nrOfElements}'/>">	
<br>
	
<table>
	<tr align="center" valign="center">
		<td align="left" width="50%">
			<input type="submit" name="save" value="删除以上数据">
			<input type="button" name="back" value="返回" onclick="javascript:window.history.back()">
		</td>
		<td width="50%">
		</td>
	</tr>
</table>

</form>
</body>
</html>